﻿using System;
using System.Collections;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList da = new ArrayList();
            da.AddRange(new int[] { 1, 3, 5, 7, 9, 11, 13 });
            int day = da.IndexOf(9);
            if (day /2 != 0)
            {
                Console.WriteLine("集合中存在这个元素");
            }
            else
            {
                Console.WriteLine("集合中不存在这个元素");
            }

            ArrayList da2 = new ArrayList();
            da2.AddRange(new int[] { 2, 4, 6, 8, 10, 12 });
            foreach (var dd in da2)
            {
                Console.Write(dd +" ");
            }
            Console.WriteLine();
            ArrayList daa = new ArrayList();
            daa.AddRange(new int[]{ 1, 3, 5, 7, 9 });
            ArrayList inda = new ArrayList();
            inda.AddRange(new int[]{ 11, 13, 15 });
            daa.InsertRange(5, inda);
            foreach (var item in daa)
            {
                Console.Write(item + " ");
            }
        }
    }
}
